<!DOCTYPE html>
<html lang="zh-CN">
<head>
	<meta charset="UTF-8">

	<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=1">
	<meta http-equiv="Cache-Control" content="no-cache, no-store, must-revalidate" />
	<meta http-equiv="Pragma" content="no-cache" />
	<meta http-equiv="Expires" content="0" />
	<meta content="yes" name="apple-mobile-web-app-capable">
	<meta content="yes" name="apple-touch-fullscreen">
	<meta content="telephone=no,email=no" name="format-detection">
	<meta name="App-Config" content="fullscreen=yes,useHistoryState=yes,transition=yes">

	<link rel="stylesheet" href="<?php echo base_url('assets/admin/css/normalize.css') ?>">
	<link rel="stylesheet" href="<?php echo base_url('assets/admin/css/bootstrap.min.css') ?>">
	<link rel="stylesheet" href="<?php echo base_url('assets/css/css.css') ?>">
	<script type="text/javascript" src="<?php echo base_url('assets/admin/js/jquery-1.11.2.min.js') ?>"></script>
	<script type="text/javascript" src="<?php echo base_url('assets/admin/js/bootstrap.min.js') ?>"></script>
	<title>后台管理登录</title>
    <style>
        .login-area{width: 500px; margin: 150px auto 0;}
    </style>
</head>
<body>
<section class="header">

</section>
<section class="login-area">
    <form id="form_ajax" class="form-horizontal" action="<?php echo site_url('admin/passport/in')?>" method="post">
        <div class="form-group">
            <label for="inputEmail3" class="col-sm-2 control-label">手机号码</label>
            <div class="col-sm-6">
                <input type="text" name="mobile" class="form-control" id="mobile" placeholder="手机号码">
            </div>
        </div>
        <div class="form-group">
            <label for="inputPassword3" class="col-sm-2 control-label">登录密码</label>
            <div class="col-sm-6">
                <input type="password" name="password" class="form-control" id="password" placeholder="密码">
            </div>
        </div>
        <div class="form-group">
            <div class="col-sm-offset-2 col-sm-10">
                <div class="checkbox">
                    <label id="msg">

                    </label>
                </div>
            </div>
        </div>
        <div class="form-group">
            <div class="col-sm-offset-2 col-sm-10">
                <button type="button" onclick="post_form()" class="btn btn-default">登录</button>
            </div>
        </div>
    </form>
</section>
<script type="text/javascript">
	$(document).ready(function(){

	});
    function to_url( url ){
        window.location.href = url;
    }
    function post_form(){
        $.post(
            '<?php echo site_url('admin/passport/in')?>',
            $( "#form_ajax" ).serialize(),
            function( data ) {
                if(data){
                    if(data.status == 1){
//                        alert(data.info);
                        to_url(data.url);
                    }else {
//                        alert(data.info);
                        $('#msg').html(data.info);
                    }
                }
            },
            'json'
        );
    }
    document.onkeydown = function(event_e){
        if( window.event )
            event_e = window.event;
        var int_keycode = event_e.charCode||event_e.keyCode;
        if(int_keycode ==13){
            //回车事件
            post_form();
        }
    }
</script>
</body>
</html>